#ifndef LUCNX_MUTEX_H
#define LUCNX_MUTEX_H

#include <Lucnx/list.h>
#include <Lucnx/task.h>

typedef struct semaphore_t
{
    u8 value;
    list waiters;
}semaphore_t;

typedef struct lock_t
{
    semaphore_t semp;
    task_t *holder;
    int acquire_nr;
}lock_t;

void lock_release(lock_t *lock);
void lock_acquire(lock_t *lock);
void lock_init(lock_t *lock);

#endif